/**配置文件 */
const router = require("../routers");
const koaBody = require("koa-body");
const static = require("koa-static");
const path = require("path");
const render = require('koa-art-template');

function initProject(app) {
    app.use(koaBody())
    app.use(router.routes());
    var res = path.join(process.cwd(), "static");
    app.use(static(res))
    
    render(app, {
        root: path.join(process.cwd(), 'pages'),
        extname: '.html',
        debug: process.env.NODE_ENV !== 'production'
    });
}

module.exports = initProject;